<?php
declare (strict_types=1);

namespace app\middleware;


use app\BaseController;
use Closure;
use think\Request;

class Login extends BaseController
{
	/**
	 * 处理请求
	 *
	 * @param Request $request
	 * @param Closure $next
	 * @return mixed
	 */
	public function handle(Request $request, Closure $next)
	{
		if ($request->user_id == 0) {
			$this->writeJson(401, '请先登录');
		}
		
		
		return $next($request);
	}
}
